<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
checkadmin(1)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>更新HTML</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
<script type="text/javascript" src="admin_js/common.js"></script>
<script type="text/javascript" src="admin_js/makehtml.js"></script>
</head>
<body>
<div>
<!--onpropertychange="monitorTxt();" oninput="monitorTxt();"-->
<form method="post" id="rzform" name="rzform">
<input type="hidden" id="mon" name="mon" value="" 
/>
<table class="table_1000" cellspacing="0" cellpadding="0">
<tr>
<th colspan="4">生成首页</th>
</tr>
<tr><td><input type='checkbox'  name='id' value='index' checked/></td><td>&nbsp;网站首页</td>
<td>
<input type="hidden" id="index"  value="makehtml_index.asp"/>
<iframe id="fr_index" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
</td>
<td>&nbsp;</td></tr>
<tr><td><input type="checkbox" name='id' value='map'/></td><td>&nbsp;网站地图</td>
<td>
<input type="hidden" id="map"  value="makehtml_map.asp"/>
<iframe id="fr_map" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
</td>
<td>&nbsp;</td></tr>
<tr><td><input type='checkbox'  name='id' value='sitemap' checked/></td><td>&nbsp;Google SiteMap</td>
<td>
<input type="hidden" id="sitemap"  value="makehtml_sitemap.asp"/>
<iframe id="fr_sitemap" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
</td>
<td>&nbsp;</td></tr>
<tr><td><input type='checkbox'  name='id' value='speciallist'/></td><td>&nbsp;专题列表首页</td>
<td>
<input type="hidden" id="speciallist"  value="makehtml_speciallist.asp"/>
<iframe id="fr_speciallist" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
</td>
<td>&nbsp;</td></tr>
<!-- <tr><td><input type='checkbox'  name='id' value='allproduct'/></td><td>&nbsp;全部商品页</td>
<td>
<input type="hidden" id="allproduct"  value="makehtml_allproduct.asp"/>
<iframe id="fr_allproduct" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
</td>
<td>&nbsp;</td></tr> -->
<tr><td><input type='checkbox'  name='id' value='friendlink'/></td><td>&nbsp;友情链接页</td>
<td>
<input type="hidden" id="friendlink"  value="makehtml_friendlink.asp"/>
<iframe id="fr_friendlink" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
</td>
<td>&nbsp;</td></tr>
<tr>
<th colspan="4">生成分类列表</th>
</tr>
<%
dim rst,sqlt,fenlei,visible,proc,proc2,path,cncount,encount,cnpage,enpage
Set rst = Server.CreateObject("ADODB.Recordset")
sqlt = "select * from [c_type] where parentid=0 and visible=1 and (fenlei<=3 or fenlei=6 or fenlei=7) order by theorder"
rst.open sqlt,conn,1,1
Do While Not rst.eof
	fenlei=rst("fenlei")
	path=CutPath(rst("path"))
	response.write("<tr>")
	response.write("<td><input type='checkbox'  name='id' value='lst"&fenlei&rst("id")&"'")
	If rst("makehtmltime")="" Or IsNull(rst("makehtmltime")) Then 
		response.write(" checked")
	Else 
		If rst("makehtmltime")<rst("modifytime") Then response.write(" checked")
	End If 
	response.write("/></td><td>")
	cncount=CaculateRecord(rst("path"),fenlei,0)
	encount=CaculateRecord(rst("path"),fenlei,1)
	Select Case fenlei
		Case 1:
		proc=RZ_PRE_ARTICLE_LIST
		proc2=RZ_PRE_ARTICLE_SHOW
		cnpage=CaculatePage(cncount,rst("perpage"))
		enpage=CaculatePage(encount,rst("perpage"))
		response.write("&nbsp;[文章]&nbsp;&nbsp;")
		Case 2:
		proc=RZ_PRE_PRODUCT_LIST
		proc2=RZ_PRE_PRODUCT_SHOW
		cnpage=CaculatePage(cncount,rst("perpage"))
		enpage=CaculatePage(encount,rst("perpage"))
		response.write("&nbsp;[商品]&nbsp;&nbsp;")
		Case 3:
		proc=RZ_PRE_PHOTO_LIST
		proc2=RZ_PRE_PHOTO_SHOW
		cnpage=CaculatePage(cncount,rst("perpage"))
		enpage=CaculatePage(encount,rst("perpage"))
		response.write("&nbsp;[图片]&nbsp;&nbsp;")
		Case 6:
		proc=RZ_PRE_TYPE_SHOW
		response.write("&nbsp;[内容]&nbsp;&nbsp;")
		Case 7:
		proc=RZ_PRE_JOB_LIST
		proc2=RZ_PRE_JOB_SHOW
		cnpage=CaculatePage(cncount,rst("perpage"))
		enpage=CaculatePage(encount,rst("perpage"))
		response.write("&nbsp;[招聘]&nbsp;&nbsp;")
	End Select
	response.write("<a title='更新时间："&rst("modifytime")&"'>"&rst("name")&"</a></td><td>")
	If fenlei<=3 Or fenlei=7 Then 
%>
<input type="hidden" id="<%="lst"&fenlei&rst("id")%>"  value="<%="makehtml_list.asp?proc="&proc&"&path="&path&"&cnpage="&cnpage&"&enpage="&enpage&"&typeid="&rst("id")%>"/>
<iframe id="<%="fr_lst"&fenlei&rst("id")%>" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;height:20px" src="about:blank" scrolling="no"></iframe>
<%Else%>
<input type="hidden" id="<%="lst"&fenlei&rst("id")%>"  value="<%="makehtml_typeshow.asp?path="&path%>"/>
<iframe id="<%="fr_lst"&fenlei&rst("id")%>" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;height:20px" src="index.html" scrolling="no"></iframe>
<%End If %>
</td>
<td>
<%
If rst("havechild")=0 And (rst("fenlei")<=3 Or rst("fenlei")=7)  And rst("recordtemplate")<>"" Then%>
<input type="hidden" id="<%="lst"&fenlei&rst("id")&"rd"%>"  value="<%="makehtml_record.asp?proc="&proc2&"&path="&path&"&typeid="&rst("id")&"&time="&GetTime(rst("makehtmltime"))%>"/>
<iframe id="<%="fr_lst"&fenlei&rst("id")&"rd"%>" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;height:20px" src="about:blank" scrolling="no"></iframe>
<%End If 
response.write("</td></tr>")
PrintChild(rst("id"))
rst.movenext
Loop
rst.close
Set rst=Nothing
%>
<%
Function PrintChild(parentid)
dim rsp,sqlp,i,fenlei,proc,proc2,path,cncount,encount,cnpage,enpage,list_url,record_url,content_url
Set rsp = Server.CreateObject("ADODB.Recordset")
sqlp = "select * from [c_type] where parentid="&parentid&" and visible=1 and (fenlei<=3 or fenlei=6 or fenlei=7) order by theorder"
rsp.open sqlp,conn,1,1
Do While Not rsp.eof
	fenlei=rst("fenlei")
	path=CutPath(rsp("path"))
	response.write("<tr>")
	response.write("<td><input type='checkbox'  name='id' value='lst"&fenlei&rsp("id")&"'")
	If rsp("makehtmltime")="" Or IsNull(rsp("makehtmltime")) Then 
		response.write(" checked")
	Else 
		If rsp("makehtmltime")<rsp("modifytime") Then response.write(" checked")
	End If 
	response.write("/></td><td>")
	cncount=CaculateRecord(rsp("path"),fenlei,0)
	encount=CaculateRecord(rsp("path"),fenlei,1)
	Select Case fenlei
		Case 1:
		proc=RZ_PRE_ARTICLE_LIST
		proc2=RZ_PRE_ARTICLE_SHOW
		cnpage=CaculatePage(cncount,rsp("perpage"))
		enpage=CaculatePage(encount,rsp("perpage"))
		response.write("&nbsp;[文章]&nbsp;&nbsp;")
		Case 2:
		proc=RZ_PRE_PRODUCT_LIST
		proc2=RZ_PRE_PRODUCT_SHOW
		cnpage=CaculatePage(cncount,rsp("perpage"))
		enpage=CaculatePage(encount,rsp("perpage"))
		response.write("&nbsp;[商品]&nbsp;&nbsp;")
		Case 3:
		proc=RZ_PRE_PHOTO_LIST
		proc2=RZ_PRE_PHOTO_SHOW
		cnpage=CaculatePage(cncount,rsp("perpage"))
		enpage=CaculatePage(encount,rsp("perpage"))
		response.write("&nbsp;[图片]&nbsp;&nbsp;")
		Case 6:
		proc=RZ_PRE_TYPE_SHOW
		response.write("&nbsp;[内容]&nbsp;&nbsp;")
		Case 7:
		proc=RZ_PRE_JOB_LIST
		proc2=RZ_PRE_JOB_SHOW
		cnpage=CaculatePage(cncount,rsp("perpage"))
		enpage=CaculatePage(encount,rsp("perpage"))
		response.write("&nbsp;[招聘]&nbsp;&nbsp;")
	End Select
	For i=1 To rsp("thelevel")-2
	response.write("&nbsp;&nbsp;")
	Next
	If rsp("thelevel")>2 Then
	response.write("└")
	End If 
	response.write("<a title='更新时间："&rsp("modifytime")&"'>"&rsp("name")&"</a></td><td>")
	If fenlei<=3 Or fenlei=7 Then
	list_url="makehtml_list.asp?proc="&proc&"&path="&path&"&cnpage="&cnpage&"&enpage="&enpage
%>
<input type="hidden" id="<%="lst"&fenlei&rsp("id")%>"  value="<%="makehtml_list.asp?proc="&proc&"&path="&path&"&cnpage="&cnpage&"&enpage="&enpage&"&typeid="&rsp("id")%>"/>
<iframe id="<%="fr_lst"&fenlei&rsp("id")%>" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;height:20px" src="about:blank" scrolling="no"></iframe>
<%Else%>
<input type="hidden" id="<%="lst"&fenlei&rsp("id")%>"  value="<%="makehtml_typeshow.asp?path="&path%>"/>
<iframe id="<%="fr_lst"&fenlei&rsp("id")%>" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;height:20px" src="index.html" scrolling="no"></iframe>
<%End If %>
</td>
<td>
<%If rsp("havechild")=0 And (rsp("fenlei")<=3 Or rsp("fenlei")=7) And rsp("recordtemplate")<>"" Then%>
<input type="hidden" id="<%="lst"&fenlei&rsp("id")&"rd"%>"  value="<%="makehtml_record.asp?proc="&proc2&"&path="&path&"&typeid="&rsp("id")&"&time="&GetTime(rsp("makehtmltime"))%>"/>
<iframe id="<%="fr_lst"&fenlei&rsp("id")&"rd"%>" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;height:20px" src="about:blank" scrolling="no"></iframe>
<%End If 
response.write("</td></tr>")
PrintChild(rsp("id"))
rsp.movenext
Loop
rsp.close
Set rsp=Nothing
End Function 
Function CaculateRecord(temppath,myfenlei,lang)
dim tablename,rsc,sqlc,recount
select case myfenlei
case 1:
	tablename="c_article"
case 2:
	tablename="c_product"
case 3:
	tablename="c_photo"
case 7:
	tablename="c_job"
case else:
	tablename=""
end select
if tablename<>"" then
Set rsc = Server.CreateObject("ADODB.Recordset")
sqlc = "select count(id) as recount from "&tablename&" where visible=1 and Instr(path,'"+temppath+"')>0 and lang="&lang
rsc.open sqlc,conn,1,1
If Not rsc.eof Then 
recount=rsc("recount")
End If 
rsc.close
Set rsc=Nothing
else
recount="未知"
end if
CaculateRecord=recount
End Function 


Function GetTime(thetime)
	GetTime=Year(thetime)&"-"&Month(thetime)&"-"&Day(thetime)&"-"&Hour(thetime)&"-"&Minute(thetime)&"-"&Second(thetime)
End Function 
%>
<tr>
<th colspan="4">生成专题内容页</th>
</tr>
<%
Set rst = Server.CreateObject("ADODB.Recordset")
sqlt = "select * from [c_special] "
rst.open sqlt,conn,1,1
Do While Not rst.eof
response.write("<tr>")
response.write("<td><input type='checkbox'  name='id' value='"&RZ_PRE_SPECIAL_SHOW&""&rst("id")&"'")
If rst("makehtmltime")="" Or IsNull(rst("makehtmltime")) Then 
	response.write(" checked")
else
	If rst("makehtmltime")<rst("modifytime") Then 
	response.write(" checked")
	End If 
End If 
response.write("/></td><td>")
response.write("&nbsp;[专题]&nbsp;&nbsp;"&rst("specialname")&"</td><td colspan='2'>")
%>
<input type="hidden" id="<%=RZ_PRE_SPECIAL_SHOW&rst("id")%>"  value="makehtml_special.asp?specialid=<%=rst("id")%>"/>
<iframe id="<%="fr_"&RZ_PRE_SPECIAL_SHOW&rst("id")%>" marginwidth="0" marginheight="0" frameborder="0" style="width:300px;height:20px" src="about:blank" scrolling="no"></iframe>
<%
response.write("</td></tr>")
rst.movenext
Loop
rst.close
Set rst=Nothing
%>
</table>
<br/>
	<div class="table_500">
	<input name="selectall" type="checkbox" id="selectall" value="" onclick="selectAll();"/>全选
	<input name="updatetype" type="radio"  value="0" checked/>增量更新&nbsp;&nbsp;<input name="updatetype" type="radio"  value="1"/>完全更新&nbsp;&nbsp;
	<input type="button" id="make" class="btn" value="生成HTML页面" onclick="makehtml();"/>
	</div>
</div>
</form>
<div class="table_500">
<ul>
<li>首页默认会被选中，有更新的分类默认会被选中。</li>
<li>“增量更新”和“完全更新”是指对文章/商品/图片<span style="color:red;">明细记录</span>的更新。</li>
<li>“增量更新”只更新上次更新以来新增加和修改的记录。</li>
<li>如果您更改了分类名称等信息，请选择“完全更新”。</li>
<li>Sitemap文件的用途及其用法请参考<a href="http://baike.baidu.com/view/1072062.htm" target="_blank">http://baike.baidu.com/view/1072062.htm</a></li>
</ul>
</div>
</body>
</html>
<%
Dim onestep
onestep=Trim(request.querystring("onestep"))
If onestep="1" Then
%>
<script type="text/javascript">
<!--
	document.getElementById("make").click();
//-->
</script>
<%
End If 
%>